<?php

namespace Zyan\LicensePlateNumber;

class Model
{
    public static array $letter = [

        'A' => '01',
        'B' => '02',
        'C' => '03',
        'D' => '04',
        'E' => '05',
        'F' => '06',
        'G' => '07',
        'H' => '08',
        'I' => '09',
        'J' => '10',
        'K' => '11',
        'L' => '12',
        'M' => '13',
        'N' => '14',
        'O' => '15',
        'P' => '16',
        'Q' => '17',
        'R' => '18',
        'S' => '19',
        'T' => '20',
        'U' => '21',
        'V' => '22',
        'W' => '23',
        'X' => '24',
        'Y' => '25',
        'Z' => '26',

        '1' => '31',
        '2' => '32',
        '3' => '33',
        '4' => '34',
        '5' => '35',
        '6' => '36',
        '7' => '37',
        '8' => '38',
        '9' => '39',
        '0' => '40',
    ];


    public static array $word = [
        "京" => "01",
        "津" => "02",
        "冀" => "03",
        "晋" => "04",
        "蒙" => "05",
        "辽" => "06",
        "吉" => "07",
        "黑" => "08",
        "沪" => "09",

        "苏" => "11",
        "浙" => "12",
        "皖" => "13",
        "闽" => "14",
        "赣" => "15",
        "鲁" => "16",
        "豫" => "17",
        "鄂" => "18",
        "湘" => "19",

        "粤" => "21",
        "桂" => "22",
        "琼" => "23",
        "渝" => "24",
        "川" => "25",
        "贵" => "26",
        "云" => "27",
        "藏" => "28",
        "陕" => "29",

        "甘" => "31",
        "青" => "32",
        "宁" => "33",
        "新" => "34",
        "港" => "35",
        "澳" => "36",
        "使" => "37",
        "领" => "38",
        "学" => "39",
        "警" => "40"
    ];


    public static function getLetter(string $name, string $color)
    {
        $model = self::$letter[$name] ?? '';
        return Utils::resources('image/letter/letter_'.$color.'_'.$model.'.png');
    }

    public static function getWord(string $name, string $color)
    {
        $model = self::$word[$name] ?? '';
        return Utils::resources('image/word/word_'.$color.'_'.$model.'.png');
    }
}
